package com.share.zabbix.entity;

import java.io.Serializable;
import java.util.Date;

import com.alibaba.fastjson.JSON;

import cn.hutool.core.date.DateUtil;
import lombok.Data;

@Data
public class ZabbixItem implements Serializable{
	
	private static final long serialVersionUID = 4899946476909211577L;

    private String itemid;
    private String hostid;
    private String name;
    private String key_;
    private String delay;
    private String lastvalue;
    private String lastclock;
    private String lastns;
    /**
     * Possible values:
		0 - (default) normal;
		1 - not supported.
     */
    private String state;
    /**
     * Status of the item.
		Possible values:
		0 - (default) enabled item;
		1 - disabled item.
     */
    private String status;
    private String prevvalue;
    private String templateid;
    private String description;
    private String time;
    
    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
    
    public String getTime() {
        return DateUtil.format(new Date(Long.parseLong(lastclock) * 1000), "yyyy-MM-dd HH:mm:ss");
    }
}
